package com.weiyi.mashangzhu.Utils;


import android.os.Handler;
import android.os.Looper;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class ThreadUtil {

    private static Handler handler = new Handler(Looper.getMainLooper());

//    private static Executor executor = Executors.newFixedThreadPool(3);
    private static Executor executor = Executors.newSingleThreadExecutor();

    public static void runOnMainThread(Runnable runnable) {
        handler.post(runnable);
    }

    public static void runOnSubThread(Runnable runnable) {
        executor.execute(runnable);
    }

}
